import vue from '@vitejs/plugin-vue'
import useAutoImport from './use-auto-import'
import useSvgIconsPlugin from './use-svg-icon'
import useComponents from './use-components'
import legacy from '@vitejs/plugin-legacy';
import { lazyImport, VxeResolver } from 'vite-plugin-lazy-import'


const useVitePlugins = () => {
  const plugins = [
    vue(),
    useComponents(),
    useAutoImport(),
    useSvgIconsPlugin(),
    legacy({
      targets: ["defaults", "not IE 11","Chrome 64"],
    }),
    lazyImport({
                  resolvers: [
                    VxeResolver({
                      libraryName: 'vxe-table'
                    }),
                    VxeResolver({
                      libraryName: 'vxe-pc-ui'
                    })
                  ]
                })
  ]

  return plugins
}

export default useVitePlugins
